package demo

import (
    "fmt"
    "io/ioutil"

    aepapi "gitee.com/dell_software_department/ctwing_sdk/apis/Aep_upgrade_management"
)

func QueryRemoteUpgradeDetail_Demo() {
    resp, err := aepapi.QueryRemoteUpgradeDetail("dFI1lzE0EN2", "xQcjrfNLvQ", "", "10015488", "cd35c680b6d647068861f7fd4e79d3f5")

    if err != nil {
        fmt.Println("QueryRemoteUpgradeDetail err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryRemoteUpgradeTask_Demo() {
    resp, err := aepapi.QueryRemoteUpgradeTask("dFI1lzE0EN2", "xQcjrfNLvQ", "", "10015488", "cd35c680b6d647068861f7fd4e79d3f5")

    if err != nil {
        fmt.Println("QueryRemoteUpgradeTask err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func ControlRemoteUpgradeTask_Demo() {
    resp, err := aepapi.ControlRemoteUpgradeTask("dFI1lzE0EN2", "xQcjrfNLvQ", "", "cd35c680b6d647068861f7fd4e79d3f5", "{}")

    if err != nil {
        fmt.Println("ControlRemoteUpgradeTask err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryRemoteUpradeDeviceList_Demo() {
    resp, err := aepapi.QueryRemoteUpradeDeviceList("dFI1lzE0EN2", "xQcjrfNLvQ", "", "10015488", "", "", "", "cd35c680b6d647068861f7fd4e79d3f5", "", "", "", "", "")

    if err != nil {
        fmt.Println("QueryRemoteUpradeDeviceList err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func DeleteRemoteUpgradeTask_Demo() {
    resp, err := aepapi.DeleteRemoteUpgradeTask("dFI1lzE0EN2", "xQcjrfNLvQ", "", "10015488", "", "cd35c680b6d647068861f7fd4e79d3f5")

    if err != nil {
        fmt.Println("DeleteRemoteUpgradeTask err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryRemoteUpgradeTaskList_Demo() {
    resp, err := aepapi.QueryRemoteUpgradeTaskList("dFI1lzE0EN2", "xQcjrfNLvQ", "10015488", "", "", "cd35c680b6d647068861f7fd4e79d3f5", "")

    if err != nil {
        fmt.Println("QueryRemoteUpgradeTaskList err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func ModifyRemoteUpgradeTask_Demo() {
    resp, err := aepapi.ModifyRemoteUpgradeTask("dFI1lzE0EN2", "xQcjrfNLvQ", "", "cd35c680b6d647068861f7fd4e79d3f5", "{}")

    if err != nil {
        fmt.Println("ModifyRemoteUpgradeTask err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func CreateRemoteUpgradeTask_Demo() {
    resp, err := aepapi.CreateRemoteUpgradeTask("dFI1lzE0EN2", "xQcjrfNLvQ", "cd35c680b6d647068861f7fd4e79d3f5", "{}")

    if err != nil {
        fmt.Println("CreateRemoteUpgradeTask err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func OperationalRemoteUpgradeTask_Demo() {
    resp, err := aepapi.OperationalRemoteUpgradeTask("dFI1lzE0EN2", "xQcjrfNLvQ", "cd35c680b6d647068861f7fd4e79d3f5", "{}")

    if err != nil {
        fmt.Println("OperationalRemoteUpgradeTask err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryRemoteUpgradeSubtasks_Demo() {
    resp, err := aepapi.QueryRemoteUpgradeSubtasks("dFI1lzE0EN2", "xQcjrfNLvQ", "", "10015488", "", "", "", "", "cd35c680b6d647068861f7fd4e79d3f5")

    if err != nil {
        fmt.Println("QueryRemoteUpgradeSubtasks err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
